import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import VueRouter from 'vue-router'



Vue.use(VueRouter);
Vue.use(ElementUI);

import Home from "./components/Home.vue"
import Login from "./components/Login.vue"
import Register from "./components/Register.vue"
import Echarts from "./components/Echarts.vue"
import China from "./components/China.vue"
import Line from "./components/Line.vue"
import echarts from "echarts";
import Add from "./components/Add.vue"

Vue.prototype.$echarts = echarts


const routes = [
  { path: '/', component: Login },
  {
    path: '/home', 
    component: Home, 
    children: [{
      path: "add",
      component: Add
    }]
  },
  { path: '/login', component: Login },
  { path: '/register', component: Register },
  { path: '/echarts', component: Echarts },
  { path: '/china', component: China },
  { path: '/line', component: Line },
]

const router = new VueRouter({
  // mode: 'history',
  routes // (缩写) 相当于 routes: routes
})


Vue.config.productionTip = false

new Vue({
  router,
  render: function (h) { return h(App) },
}).$mount('#app')
